<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:m="http://www.ol4jsf.org"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:o="http://openfaces.org/"
	template="/WEB-INF/esquema/toolbarTemplate.xhtml">


	<ui:define name="customContent">
	</ui:define>
	
	<ui:define name="mainControls">
		<h:form>
			<h:outputText value="#{messages['txt.quick_search']}   " style="font-weight:bold;" />
			<h:selectOneMenu value="#{parcelQueryHelper.searchSelector}">
				<f:selectItem itemValue="0" itemLabel="#{messages['txt.field_tab']}"/>
				<f:selectItem itemValue="1" itemLabel="#{messages['txt.municipal_key']}"/>
				<f:selectItem itemValue="2" itemLabel="#{messages['txt.cadastral_key']}"/>
			</h:selectOneMenu>
			<h:outputText value="  " />
			<h:inputText value="#{parcelQueryHelper.searchText}" />
			<h:outputText value="  " />
			<h:commandButton value="#{messages['txt.search']}" action="#{parcelQueryHelper.doNewSearch}" reRender="searchResult" />
		</h:form>
	</ui:define>

	<ui:define name="extraControls">
		<o:commandButton value="#{messages['txt.new_search']}" onclick="back2analysis();" />
	</ui:define>

	<ui:define name="body">
		<a4j:loadScript src="#{generalHelper.openLayersJS}" />
		<div align="center">
			<br />
			<h3>CONSULTA DE PARCELAS</h3>
			<rich:separator lineType="solid"/>
			<br />
			<h:panelGroup id="searchResult">
				<h:panelGroup rendered="#{parcelQueryHelper.selectedParcel != null}">
					<ui:include src="/WEB-INF/includes/viewParcelHeader.xhtml">
						<ui:param name="parcel" value="#{parcelQueryHelper.selectedParcel}" />
					</ui:include>
					<br />
					<rich:tabPanel id="queryTabPanel" switchType="ajax">
						<rich:tab label="#{messages['query.zone.location_and_data']}" >
							<ui:include src="/WEB-INF/includes/viewParcelAdminData.xhtml">
								<ui:param name="parcel" value="#{parcelQueryHelper.selectedParcel}" />
							</ui:include>
						</rich:tab>
						<rich:tab label="#{messages['query.zone.rrr']}" >
							<ui:include src="/WEB-INF/includes/viewParcelRRR.xhtml">
								<ui:param name="parcel" value="#{parcelQueryHelper.selectedParcel}" />
							</ui:include>
						</rich:tab>
						<rich:tab label="#{messages['query.zone.transactions']}" >
						</rich:tab>
						<rich:tab label="#{messages['query.zone.permits']}" >
						</rich:tab>
						<rich:tab label="#{messages['query.zone.history']}" >
							<div align="center">
								<strong>Predecesor(es)</strong>
								<rich:separator lineType="solid"/>
								<br />
								<ui:include src="/WEB-INF/includes/viewSelectedParcelPredSucc.xhtml">
									<ui:param name="predSucc" value="0" />
								</ui:include>
								<br />
								<br />
								<strong>Sucesor(es)</strong>
								<rich:separator lineType="solid"/>
								<br />
								<ui:include src="/WEB-INF/includes/viewSelectedParcelPredSucc.xhtml">
									<ui:param name="predSucc" value="1" />
								</ui:include>
							</div>
						</rich:tab>
						<rich:tab label="#{messages['query.zone.spatial_relations']}" action="#{spatialAnalysisHelper.doNewSpatialAnalysis}">
							<div align="center">
								<br />
								<ui:include src="/viewer/includes/spatialAnalysisContentInteractionsIncl.xhtml" />
							</div>
						</rich:tab>
					</rich:tabPanel>
				</h:panelGroup>
				
				<h:panelGroup rendered="#{parcelQueryHelper.selectedParcel == null}">
					<br />
					No hay parcela seleccionada o parcela buscada inexistente
					<br />
					Defina el criterio de busqueda en las ventanas emergente por medio de las opciones de la barra lateral
				</h:panelGroup>
			</h:panelGroup>

			<br />
			<br />

		</div>
		<br />
	</ui:define>
</ui:composition>
